package com.zjitc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.InternalResourceView;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/19 15:57
 * @description:
 */
@Controller
public class GiveDataController {
  @RequestMapping("/data")
  public ModelAndView handler(){
    ModelAndView modelAndView = new ModelAndView();


    modelAndView.setView(new InternalResourceView("/data.jsp"));

    //request.setAttribute(key.value);
    modelAndView.addObject("age",23);
    modelAndView.addObject("name","沈杰");

    return modelAndView;
  }
}
